***Drezner-Fowler article. Do-file for tables and graphs 

*/
 
use /Users/lindalfowler/Desktop/House.SenateComm.95-20.rev.1-20-25.dta

xtset cmte

***Output for first column of Table 1--totwit1 and Figure 4***

nbreg totwit1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0, vce(robust)
zip expert1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)


***Output for Figure 4 ***
nbreg totwit1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0, vce(robust)
margins, at (totdays=(.5(.5)3))
marginsplot

nbreg totwit1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0, vce(robust)
margins, at(champol=(.6645 .7340 .7865 .8055 .8885))
margins, at(champol=(.6645 .7340 .7865 .8055 .8885))
marginsplot


*** Output for columns 2,3,4 of Table 1--expert1, academic, thinktank--and Figure 5***
zip expert1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

zip academic totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

zip thinktank totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0, inflate(nom budget closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

***Output for Figure 6 by cmte (based on output for Table 1 columns 2,3,4)***
zip expert1 totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3)) vsquish
marginsplot

zip academic totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3)) vsquish
marginsplot

zip thinktank totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0, inflate(nom budget closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3)) vsquish
marginsplot

***ziologit output for witness dummy variables for Table B in AppendixB and Figure 7***
ziologit expdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

ziologit acaddum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

ziologit thinkdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins, at(totdays=(.5(.5)3))
marginsplot

***ziologit for Figure 8 academics and think tank reps by cmte and total days***
ziologit acaddum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3)) vsquish
marginsplot

ziologit thinkdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins i.cmte, at(totdays=(.5(.5)3)) vsquish
marginsplot

***ziologit for Figure 9 graph of academics and think tank reps with effect of casualties by cmte--zip and ziologit***
zip academic totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget closed) vce(robust)
margins i.cmte,at(casyr=(100(100)1000)) vsquish
marginsplot

zip thinktank totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget close) vce(robust)
margins i.cmte,at(casyr=(100(100)1000)) vsquish
marginsplot

ziologit acaddum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget close) vce(robust)
margins i.cmte,at(casyr=(100(100)1000)) vsquish
marginsplot

ziologit thinkdum totdays champol casyr pctimptprob i.cmte chrdifsen chrdifhs year if totwit1 > 0,inflate(nom budget close) vce(robust)
margins i.cmte,at(casyr=(100(100)1000)) vsquish
marginsplot


clear

/*

***Output for Figure 1. data set for selected variables by year were created with the collapse command in STATA: collapse (sum) totdays newdays academic thinktank expert1 totwit1 closed hearing, by(year). The results were copied into a spreadsheet and then converted to a .dta file with N=26 observations.  Be sure to create a dummy of the full dataset before using collapse***

*/
use "/Users/lindalfowler/Desktop/House.Senate.yr 1-23-25.dta"

twoway (connected totdays year, sort) (connected newdays year, sort) (connected hearing year), ytitle(`"Number of days/hearings"') xtitle(`"Year"') graphregion(fcolor(white))

clear
/*

***Output for Figures 2A (total wit) and 2B (total experts). these required creating new variables for length of hearing***
*/

use "/Users/lindalfowler/Desktop/Variables for Fig 2A and 2B.1-30-25.dta"

twoway (connected totdayshalf year, sort msymbol(diamond)) (connected totwitdayseq1 year, sort msymbol(square )) (connected totwithdaygt1 year, sort msymbol(triangle)) (connected totwit1 year, sort msymbol(circle)),  ytitle(`"Mean Number Witnesses by Num Hearing Days"') xtitle(`"Year"') graphregion(fcolor(white))

twoway (connected expdayshdalf year, sort msymbol(diamond)) (connected expday1 year, sort msymbol(square))  (connected expdaygt1 year, sort msymbol(triangle)) (connected totexp year, msymbol(circle)), ytitle(`"Mean number witnesses per hearing"') xtitle(`"Year"') graphregion(fcolor(white))






clear
/*

***Output for Figures 3A and 3B.  Dataset collapsed by year and cmte: collapse (sum) totdays newdays academic thinktank expert1 totwit1 closed hearing, by(cmte year). Then copied to a spread sheet and then converted to .dta  N=104***

*/
use "/Users/lindalfowler/Desktop/House.Senate. comm & yr 1-23-25.dta"

***Figure 3A Totwit by cmte ***
twoway (connected totwit1 year if cmte==1, sort) (connected totwit1 year if cmte==2, sort) (connected totwit1 year if cmte==3, sort) (connected totwit1 year if cmte==4, sort), ytitle(`"Number witnesses per year"') ylabel(0(100)600) xtitle(`"Year"') graphregion(fcolor(white))

***Figure 3B prroportion experts by cmte***
twoway (connected propexpt year if cmte==1, sort) (connected propexpt year if cmte==2, sort) (connected propexpt year if cmte==3, sort) (connected propexpt year if cmte==4, sort), ytitle(`"Proportion expert witnesses per year"')  xtitle(`"Year"') graphregion(fcolor(white))
/*
clear
